<?php /*a:5:{s:113:"/www/wwwroot/dianshu/application/admin/view/default/../../../plugins/view/expressforkdn/index/public/content.html";i:1568885128;s:72:"/www/wwwroot/dianshu/application/admin/view/default/goods/save_info.html";i:1574833142;s:70:"/www/wwwroot/dianshu/application/admin/view/default/public/header.html";i:1568774834;s:64:"/www/wwwroot/dianshu/application/admin/view/default/lib/seo.html";i:1568774834;s:70:"/www/wwwroot/dianshu/application/admin/view/default/public/footer.html";i:1572600796;}*/ ?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="<?php echo config('shopxo.default_charset', 'utf-8'); ?>" />
	<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1" />
	<title>ShopXO后台管理系统</title>
	<link rel="stylesheet" type="text/css" href="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/assets/css/amazeui.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/amazeui-switch/amazeui.switch.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/amazeui-chosen/amazeui.chosen.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/amazeui-tagsinput/amazeui.tagsinput.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/css/common.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/admin/<?php echo htmlentities($default_theme); ?>/css/common.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/admin/<?php echo htmlentities($default_theme); ?>/css/iconfontmenu.css" />
    <?php if(!empty($plugins_css)): ?>
        <link rel="stylesheet" type="text/css" href="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/<?php echo htmlentities($plugins_css); ?>" />
    <?php endif; if(!empty($module_css)): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/<?php echo htmlentities($module_css); ?>" />
	<?php endif; ?>

	<!-- css钩子 -->
    <?php if(!empty($plugins_admin_css_data) and is_array($plugins_admin_css_data)): foreach($plugins_admin_css_data as $hook): if(is_string($hook)): ?>
                <link rel="stylesheet" type="text/css" href="<?php echo htmlentities($hook); ?>?v=<?php echo MyC('home_static_cache_version'); ?>" />
            <?php elseif(is_array($hook)): foreach($hook as $hook_css): if(is_string($hook_css)): ?>
                        <link rel="stylesheet" type="text/css" href="<?php echo htmlentities($hook_css); ?>?v=<?php echo MyC('home_static_cache_version'); ?>" />
                    <?php endif; ?>
                <?php endforeach; ?>
            <?php endif; ?>
        <?php endforeach; ?>
    <?php endif; ?>

    <!-- 公共header内钩子 -->
	<?php if(!empty($plugins_admin_common_header_data) and is_array($plugins_admin_common_header_data)): foreach($plugins_admin_common_header_data as $hook): if(is_string($hook) or is_int($hook)): ?>
				<?php echo $hook; ?>
			<?php endif; ?>
		<?php endforeach; ?>
	<?php endif; ?>
</head>
<script type="text/javascript">
	var __attachment_host__ = '<?php echo htmlentities($attachment_host); ?>';
</script>
<body>
<!-- 公共顶部钩子 -->
<?php if(!empty($plugins_admin_view_common_top_data) and is_array($plugins_admin_view_common_top_data) and (!isset($is_header) or $is_header == 1)): foreach($plugins_admin_view_common_top_data as $hook): if(is_string($hook) or is_int($hook)): ?>
			<?php echo $hook; ?>
		<?php endif; ?>
	<?php endforeach; ?>
<?php endif; ?>
 
<!-- right content start  -->
<div class="content-right">
    <div class="content">
        <!-- form start -->
           <legend>
                <span class="fs-16">
                    <?php if(empty($data['id'])): ?>
                    商品添加
                    <?php else: ?>
                    商品编辑
                    <?php endif; ?>
                </span>
                <a href="<?php echo MyUrl('admin/goods/index', $params); ?>" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
                
            </legend>
          <legend>
                <span class="fs-12"> 
                    请根据商品类型，选择添加方式
                    
                </span>
               
            </legend>
         <legend>
                <span  style="font-size:22px;"> 
                    扫码枪上书  <input type="text"  name="code"  style="height:40px; font-size:16px;"  value="" placeholder="请扫描书后条形码">  
           
                   &nbsp; &nbsp; &nbsp; &nbsp; 查询上书  <input type="text"   name="isbn" style="height:40px; font-size:16px;" value=""  placeholder="请输入isbn编号">  
                </span> 
               <button type="submit" class="am-btn  am-radius am-btn-primary " data-am-loading="{loadingText:'处理中...'}">搜索</button>
                    
            </legend>
           <form class="am-form form-validation view-save" action="<?php echo MyUrl('admin/goods/save'); ?>" method="POST" request-type="ajax-url" request-value="<?php echo MyUrl('admin/goods/index', $params); ?>" enctype="multipart/form-data">
      

<!--            <nav class="goods-nav">
                <ul>
                    <li>
                        <a href="#goods-nav-base">基础信息</a>
                    </li>
                    <li>
                        <a href="#goods-nav-operations">商品规格</a>
                    </li>
                    <li>
                        <a href="#goods-nav-photo">商品相册</a>
                    </li>
                    <li>
                        <a href="#goods-nav-video">商品视频</a>
                    </li>
                    <li>
                        <a href="#goods-nav-app">手机端详情</a>
                    </li>
                    <li>
                        <a href="#goods-nav-web">电脑端详情</a>
                    </li>
                    <li>
                        <a href="#goods-nav-extends">扩展数据</a>
                    </li>
                    <li>
                        <a href="#goods-nav-seo">SEO</a>
                    </li>
                </ul>
            </nav>-->

            <!-- 基础信息 -->
            <div id="goods-nav-base" class="division-block">
                <label class="block nav-detail-title">基础信息</label>
                <div class="am-form-group">
                    <label><span class="am-form-group-label-tips" style="color:red">*</span>书名</label>
                    <div class="am-input-group am-input-group-sm" style="display: -webkit-inline-box;width:80%">
                       
                        <input   type="text" name="title" placeholder="标题名称" minlength="2" maxlength="60" data-validation-message="书名格式 2~60 个字符" class="am-form-field am-radius" <?php if(!empty($data)): ?> value="<?php echo htmlentities($data['title']); ?>" <?php endif; if(!empty($data['title_color'])): ?> style="color:<?php echo htmlentities($data['title_color']); ?>;" <?php endif; ?> required />
                               <span class="am-input-group-btn">
                            <button class="am-btn am-btn-default am-btn-xs colorpicker-submit" type="button" data-input-tag="input[name='title']" data-color-tag="input[name='title_color']">
                                <img src="<?php echo htmlentities($attachment_host); ?>/static/common/images/colorpicker.png" />
                            </button>
                        </span>
                    </div>
                </div>
                  <div class="am-form-group">
                    <label><span class="am-form-group-label-tips" style="color:red">*</span>作者<span class="am-form-group-label-tips"></span></label>
                    <input type="text"  style="display: -webkit-inline-box;width:80%" name="author" placeholder="作者"   class="am-radius" value="<?php if(empty($data)): else: ?><?php echo htmlentities($data['author']); ?><?php endif; ?>" required />
                </div>
                  <div class="am-form-group">
                    <label><span class="am-form-group-label-tips" style="color:red">*</span>出版社</label>
                    <input type="text"  style="display: -webkit-inline-box;width:80%" name="press" placeholder="出版社"   class="am-radius" value="<?php if(empty($data)): else: ?><?php echo htmlentities($data['press']); ?><?php endif; ?>" required />
                </div>
                    <div class="am-form-group">
                    <label><span class="am-form-group-label-tips" style="color:red">*</span>出版时间</label>
                    <div style="display:inline-flex;width:80%" >
                    <select name="pubdate"  class="am-radius chosen-select" minchecked="1" data-placeholder="请选择..." data-validation-message="请选择出版时间" required > 
                        <?php if(!empty($pubDate)): foreach($pubDate as $k=>$v): ?>
                        <option value="<?php echo htmlentities($k); ?>"  <?php if(!empty($data['pubdate']) and ( $k== $data['pubdate'])): ?>selected<?php endif; ?>>一级 - <?php echo htmlentities($k); ?></option>
                        <?php if(!empty($v)): foreach($v as $kk=>$vs): ?>
                        <option style="padding-left: 30px;" value="<?php echo htmlentities($vs); ?>" <?php if(!empty($data['pubdate']) and ($vs== $data['pubdate'])): ?>selected<?php endif; ?>  >二级-<?php echo htmlentities($vs); ?></option>
                        <?php endforeach; ?>
                        <?php endif; ?>
                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                    </div>
                </div>
                     <div class="am-form-group">
                    <label><span class="am-form-group-label-tips" style="color:red">*</span>装帧</label>
                    <input type="radio" name="binding" value="1" <?php if(!empty($data['binding']) and $data['binding']==1): ?>checked<?php endif; ?>>平装&nbsp;&nbsp;
                    <input type="radio" name="binding" value="2" <?php if(!empty($data['binding']) and $data['binding']==2): ?>checked<?php endif; ?>>精装&nbsp;&nbsp;
                    <input type="radio" name="binding" value="3" <?php if(!empty($data['binding']) and $data['binding']==3): ?>checked<?php endif; ?>>软精装&nbsp;&nbsp;
                    <input type="radio" name="binding" value="4" <?php if(!empty($data['binding']) and $data['binding']==4): ?>checked<?php endif; ?>>线装&nbsp;&nbsp;   
                    <input type="radio" name="binding" value="5" <?php if(!empty($data['binding']) and $data['binding']==5): ?>checked<?php endif; ?>>其他&nbsp;&nbsp;   
                </div> 
                <div class="am-form-group">
                    <div>
                        <label><span class="am-form-group-label-tips" style="color:red">*</span>货架号</label>
                        <input type="text" name="shelf_number"  style="display: -webkit-inline-box;width:80%" placeholder="货架号" maxlength="30" data-validation-message="货架号格式 最多15个字符" class="am-radius" <?php if(!empty($data)): ?> value="<?php echo htmlentities($data['shelf_number']); ?>" <?php elseif(!empty($session_shelf_number)): ?> value="<?php echo htmlentities($session_shelf_number); ?>" <?php endif; ?> required/>
                    </div> 
                </div>    
                   <div class="am-form-group">
                    <label><span class="am-form-group-label-tips" style="color:red">*</span>品相</label>
                     <div style="display:inline-block;width:80%" >
                    <select name="quality" class="am-radius chosen-select"   data-placeholder="可选择..." data-validation-message="请选择品相信息" required>
                        <option value="">可选择...</option>
                        <?php if(!empty($quality)): foreach($quality as $k=>$v): ?>

                        <option style="padding-left: 30px;" value="<?php echo htmlentities($k); ?>" <?php if(!empty($data['quality']) and $data['quality']==$k): ?>selected<?php endif; ?>><?php echo htmlentities($v); ?></option>

                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                     </div>
                </div>
                  <div class="am-form-group">
                    <label><span class="am-form-group-label-tips" style="color:red">*</span>商品分类</label>
                    
                    <select  style="display: -webkit-inline-box;width:80%" name="category_id" class="am-radius chosen-select" multiple="multiple" minchecked="1" data-placeholder="请选择..." data-validation-message="请至少选择一个商品分类" required>
                        <?php if(!empty($goods_category_list)): foreach($goods_category_list as $v): ?>
                        <option value="<?php echo htmlentities($v['id']); ?>" <?php if(!empty($data['category_ids']) and in_array($v['id'], $data['category_ids'])): ?>selected<?php endif; ?>>一级 - <?php echo htmlentities($v['name']); ?></option>
                        <?php if(!empty($v['items'])): foreach($v['items'] as $vs): ?>
                        <option style="padding-left: 30px;" value="<?php echo htmlentities($vs['id']); ?>" <?php if(!empty($data['category_ids']) and in_array($vs['id'], $data['category_ids'])): ?>selected<?php endif; ?>>二级-<?php echo htmlentities($vs['name']); ?></option>
                        <?php if(!empty($vs['items'])): foreach($vs['items'] as $vss): ?>
                        <option style="padding-left: 60px;" value="<?php echo htmlentities($vss['id']); ?>" <?php if(!empty($data['category_ids']) and in_array($vss['id'], $data['category_ids'])): ?>selected<?php endif; ?>>三级-<?php echo htmlentities($vss['name']); ?></option>
                       
                         
                        
                        <?php endforeach; ?>    
                        <?php endif; ?>
                        <?php endforeach; ?>
                        <?php endif; ?>
                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                </div>
                 <!-- 规格 -->
                <div id="goods-nav-operations" class="division-block" data-spec-add-max-number="<?php echo MyC('common_spec_add_max_number', 3, true); ?>">
                    <label class="block nav-detail-title">商品规格</label>
                    <!-- <span class="business-operations-submit specifications-nav-title-add">+添加规格</span>-->
                    <div class="goods-specifications">
                        <table class="am-table am-table-bordered am-table-centered specifications-table m-t-10 m-b-10">
                            <thead class="title-nav">
                                <tr>


                                    <th class="title-start"><span class="am-form-group-label-tips" style="color:red">*</span>售价(元)</th>
                                    <th><span class="am-form-group-label-tips" style="color:red">*</span>库存数量</th>


                                    <th>重量（kg）</th>

                                    <th>原定价(元)</th>

                                </tr>
                            </thead>
                            <tbody>
                                  <?php if(empty($specifications['value'])): ?>
                                <tr class="line-0" data-line-tag=".line-0">
                                    <td class="value-start">
                                        <input type="text" name="specifications_price[]" placeholder="价格" class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效售价"   required />
                                    </td>
                                    <td>
                                        <input type="number" name="specifications_inventory[]" placeholder="库存"    class="am-radius" min="1" max="10000" pattern="^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$" data-validation-message="库存数量 1~10000" required />
                                    </td>
                                    <td>
                                        <input type="number" name="specifications_weight[]" placeholder="重量"   class="am-radius" maxlength="80" min="0" max="100000000"   />
                                    </td>
                                    <td>
                                        <input type="text" name="specifications_original_price[]" placeholder="原价"   class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的原价" />
                                    </td>
                                </tr>
                                  <?php endif; if(!empty($specifications['value'])): foreach($specifications['value'] as $line_k=>$line_v): ?>
                                          <tr class="line-<?php echo htmlentities($line_k); if($line_k > 0): ?> line-not-first<?php endif; ?>" data-line-tag=".line-<?php echo htmlentities($line_k); ?>">
                                <?php foreach($line_v as $v): if(isset($v['data_type'])): ?>
                               
                               
                                    <td class="value-start">
                                        <input type="text" name="specifications_price[]" placeholder="价格" class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" data-validation-message="请填写有效的售价"  value="<?php echo htmlentities($v['data']['price']); ?>" required />
                                    </td>
                                    <td>
                                        <input type="number" name="specifications_inventory[]" placeholder="库存"   value="<?php echo htmlentities($v['data']['inventory']); ?>" class="am-radius" min="1" max="10000" pattern="^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$"   required />
                                    </td>
                                    <td>
                                        <input type="number" name="specifications_weight[]" placeholder="重量" value="<?php if($v['data']['weight'] > 0): ?><?php echo htmlentities($v['data']['weight']); ?><?php endif; ?>" class="am-radius" maxlength="80" min="0" max="100000000" step="0.01"  />
                                    </td>
                                    <td>
                                        <input type="text" name="specifications_original_price[]" placeholder="原价"  value="<?php if($v['data']['original_price'] > 0): ?><?php echo htmlentities($v['data']['original_price']); ?><?php endif; ?>" class="am-radius" pattern="^([0-9]{1}\d{0,6})(\.\d{1,2})?$" />
                                    </td>
                                       
                                <?php endif; ?>
                                <?php endforeach; ?>
                            </tr>
                             <?php endforeach; ?>
                            <?php endif; ?>
                            </tbody>
                        </table>
                       
                  
                          <!-- 相册 -->
                    <div id="goods-nav-photo" class="division-block">
                        <label class="block nav-detail-title"><span class="am-form-group-label-tips" style="color:red">*</span>商品相册<span class="am-form-group-label-tips">可拖拽图片进行排序，建议图片尺寸一致</span></label>
                        <ul class="plug-file-upload-view goods-photo-view" data-form-name="photo[]" data-max-number="30" data-dialog-type="images">
                            <?php if(!empty($data['photo'])): foreach($data['photo'] as $v): ?>
                            <li>
                                <input type="text" name="photo[]" value="<?php echo htmlentities($v['images_old']); ?>" />
                                <img src="<?php echo htmlentities($v['images']); ?>" />
                                <i>×</i>
                            </li>
                            <?php endforeach; ?>
                            <?php endif; ?>
                        </ul>
                        <div class="plug-file-upload-submit" data-view-tag="ul.goods-photo-view">+上传相册</div>
                    </div>
                <div class="am-form-group">
                    <label>推荐语</label>
                    <input type="text" style="display: -webkit-inline-box;width:80%" name="simple_desc" placeholder="推荐语" maxlength="160" data-validation-message="推荐语格式 最多160个字符" class="am-radius" <?php if(!empty($data)): ?> value="<?php echo htmlentities($data['simple_desc']); ?>"<?php endif; ?> />


                </div>
              
              
                <div class="am-form-group">
                    <label>所属仓库</label>
                    <select  style="display: -webkit-inline-box;width:80%"  name="warehouse_id" class="am-radius chosen-select"   >
                        
                        <?php if(!empty($warehouse_list)): foreach($warehouse_list as $k=>$v): ?>
                                    
                                 <option style="padding-left: 30px;" value="<?php echo htmlentities($v['id']); ?>" <?php if(!empty($data) and  $v['id'] ==$data['wid']): ?>selected<?php endif; ?>><?php echo htmlentities($v['warehouse_name']); ?></option>
                                 
                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                </div>
                <div class="am-form-group" >
                    <label>ISBN<span class="am-form-group-label-tips"></span></label>
                    <input  type="text"  style="display: -webkit-inline-box;width:80%" name="isbn" placeholder="ISBN"   class="am-radius" value="<?php if(empty($data)): else: ?><?php echo htmlentities($data['isbn']); ?><?php endif; ?>"  />
                </div>
              
                <div class="am-form-group">
                    <label>印数<span class="am-form-group-label-tips"></span></label>
                    <input type="text"  style="display: -webkit-inline-box;width:80%" name="impression" placeholder="印数"   class="am-radius" value="<?php if(empty($data)): else: ?><?php echo htmlentities($data['impression']); ?><?php endif; ?>"  />
                </div>
                <div class="am-form-group">
                    <label>页数<span class="am-form-group-label-tips"></span></label>
                    <input type="text"  style="display: -webkit-inline-box;width:80%" name="number" placeholder="页数"   class="am-radius" value="<?php if(empty($data)): else: ?><?php echo htmlentities($data['number']); ?><?php endif; ?>"  />
                </div>
               
              
            
                <div class="am-form-group">
                    <label>印刷时间<span class="am-form-group-label-tips"></span></label>
                      <input type="text"  style="display: -webkit-inline-box;width:80%" name="publishingdate" class="am-radius Wdate" placeholder="印刷时间" pattern="<?php echo lang('common_regex_date'); ?>" data-validation-message="印刷时间格式有误" <?php if(!empty($data)): ?> value="<?php echo htmlentities($data['publishingdate']); ?>" <?php endif; ?> onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" />
			
                </div>

           


                <div class="am-form-group">
                    <label>开本</label>
                     <div style="display:-webkit-inline-box;width:80%" >
                    <select name="openbook"  style="display: -webkit-inline-box;width:80%"  class="am-radius chosen-select" data-placeholder="可选择..." data-validation-message="请选择开本信息">
                        <option value="">可选择...</option>
                        <?php if(!empty($openBook)): foreach($openBook as $k=>$v): ?>

                        <option style="padding-left: 30px;" value="<?php echo htmlentities($v); ?>"  <?php if(!empty($data['openbook']) and $data['openbook']==$v): ?>selected<?php endif; ?>><?php echo htmlentities($v); ?></option>

                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                     </div>
                </div>
                
               
                <div class="am-form-group">
                    <label>纸张<span class="am-form-group-label-tips"></span></label>
                    <input type="radio" name="paperypte" value="1" <?php if(!empty($data['paperypte']) and $data['paperypte']==1): ?>checked<?php endif; ?>>胶版纸&nbsp;&nbsp;
                    <input type="radio" name="paperypte" value="2" <?php if(!empty($data['paperypte']) and $data['paperypte']==2): ?>checked<?php endif; ?>>铜版纸&nbsp;&nbsp;
                    <input type="radio" name="paperypte" value="3" <?php if(!empty($data['paperypte']) and $data['paperypte']==3): ?>checked<?php endif; ?>>轻型纸&nbsp;&nbsp;
                    <input type="radio" name="paperypte" value="4" <?php if(!empty($data['paperypte']) and $data['paperypte']==4): ?>checked<?php endif; ?>>纯质纸&nbsp;&nbsp;   
                    <input type="radio" name="paperypte" value="5" <?php if(!empty($data['paperypte']) and $data['paperypte']==5): ?>checked<?php endif; ?>>其他&nbsp;&nbsp;   
                </div> 
                 <div class="am-form-group">
                    <label>所属书单</label>
                    <select  style="display: -webkit-inline-box;width:80%"  name="booksList" class="am-radius chosen-select" multiple="multiple"  data-placeholder="可选择..." data-validation-message="请选择所属书单" >
                        <option value="">可选择...</option>
                        <?php if(!empty($booksList)): foreach($booksList as $k=>$v): ?>
                            
                                 <option style="padding-left: 30px;" value="<?php echo htmlentities($v['id']); ?>" <?php if(!empty($data) and  in_array($v['id'], $data['books_goods'])): ?>selected<?php endif; ?>><?php echo htmlentities($v['title']); ?></option>
                          
                        <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                </div>
               
                        <div class="am-form-group am-form-file">
                            <label class="block">首页推荐图片<span class="am-form-group-label-tips">留空则取相册第一张图</span></label>
                            <ul class="plug-file-upload-view goods-recommended-images-view" data-form-name="home_recommended_images" data-max-number="1" data-dialog-type="images">
                                <?php if(!empty($data['home_recommended_images'])): ?>
                                <li>
                                    <input type="text" name="home_recommended_images" value="<?php echo htmlentities($data['home_recommended_images']); ?>" />
                                    <img src="<?php echo htmlentities($data['home_recommended_images']); ?>" />
                                    <i>×</i>
                                </li>
                                <?php endif; ?>
                            </ul>
                            <div class="plug-file-upload-submit" data-view-tag="ul.goods-recommended-images-view">+上传图片</div>
                        </div>
                        <div class="am-form-group">
                            <label class="block">扣减库存<span class="am-form-group-label-tips">扣除规则根据后台配置->扣除库存规则而定</span></label>
                            <input name="is_deduction_inventory" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch <?php if((isset($data['is_deduction_inventory']) and $data['is_deduction_inventory'] == 1) or empty($data)): ?>checked="true"<?php endif; ?> />
                        </div>
                        <div class="am-form-group">
                            <label class="block">上下架<span class="am-form-group-label-tips">下架后用户不可见</span></label>
                            <input name="is_shelves" value="1" type="checkbox" data-off-text="下架" data-on-text="上架" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch <?php if((isset($data['is_shelves']) and $data['is_shelves'] == 1) or empty($data)): ?>checked="true"<?php endif; ?> />
                        </div>
                        <div class="am-form-group">
                            <label class="block">首页推荐<span class="am-form-group-label-tips">推荐后在首页展示</span></label>
                            <input name="is_home_recommended" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch <?php if(isset($data['is_home_recommended']) and $data['is_home_recommended'] == 1): ?>checked="true"<?php endif; ?> />
                        </div>
                        
                        <div class="am-form-group">
                            <label class="block">最新上架</label>
                            <input name="new_upper" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch <?php if((isset($data['new_upper']) and $data['new_upper'] == 1) or empty($data)): ?>checked="true"<?php endif; ?> />
                        </div>
                        <div class="am-form-group">
                            <label class="block">每日推荐</label>
                            <input name="recommended_daily" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch <?php if((isset($data['recommended_daily']) and $data['recommended_daily'] == 1) or empty($data)): ?>checked="true"<?php endif; ?> />
                        </div>
                        <div class="am-form-group">
                            <label class="block">珍品孤本</label>
                            <input name="rare_treasures" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch <?php if(isset($data['rare_treasures']) and $data['rare_treasures'] == 1): ?>checked="true"<?php endif; ?> />
                        </div>
                    </div>


                  

                    <!-- 视频 
                    <div id="goods-nav-video" class="division-block">
                        <label class="block nav-detail-title">商品视频</label>
                        <div class="am-form-group am-form-file">
                            <label class="block">短视频<span class="am-form-group-label-tips">视频比图文更有具带入感，仅支持 mp4 格式</span></label>
                            <ul class="plug-file-upload-view plug-file-upload-view-video goods-video-view" data-form-name="video" data-max-number="1" data-dialog-type="video">
                                <?php if(!empty($data['video'])): ?>
                                <li>
                                    <input type="text" name="video" value="<?php echo htmlentities($data['video']); ?>" />
                                    <video src="<?php echo htmlentities($data['video']); ?>" controls>your browser does not support the video tag</video>
                                    <i>×</i>
                                </li>
                                <?php endif; ?>
                            </ul>
                            <div class="plug-file-upload-submit" data-view-tag="ul.goods-video-view">+上传视频</div>
                        </div>
                    </div>
                    -->
                    <!-- app内容 -->
                    <div id="goods-nav-app" class="division-block">
                        <label class="block nav-detail-title">手机端详情</label>
                        <ul class="content-app-items" data-max-count="10" data-required="1" data-images-name="content_app_images" data-content-name="content_app_text" data-images-text="图片" data-content-text="文本内容" data-delete-text="删除" data-drag-sort-text="拖拽排序">
                            <?php if(!empty($data['content_app'])): foreach($data['content_app'] as $v): ?>
                            <li>
                                <div>
                                    <div class="content-app-left">
                                        <label class="block">图片</label>
                                        <ul class="plug-file-upload-view goods-content-app-images-view-<?php echo htmlentities($v['id']); ?>" data-form-name="content_app_images_<?php echo htmlentities($v['id']); ?>" data-max-number="1" data-dialog-type="images">
                                            <?php if(!empty($v['images'])): ?>
                                            <li>
                                                <input type="text" name="content_app_images_<?php echo htmlentities($v['id']); ?>" value="<?php echo htmlentities($v['images_old']); ?>" />
                                                <img src="<?php echo htmlentities($v['images']); ?>" />
                                                <i>×</i>
                                            </li>
                                            <?php endif; ?>
                                        </ul>
                                        <div class="plug-file-upload-submit" data-view-tag="ul.goods-content-app-images-view-<?php echo htmlentities($v['id']); ?>">+上传图片</div>
                                    </div>
                                    <div class="am-form-group content-app-right fr">
                                        <label>文本内容</label>
                                        <textarea rows="5" name="content_app_text_<?php echo htmlentities($v['id']); ?>" maxlength="105000" class="am-radius" placeholder="文本内容" data-validation-message="文本内容最多 105000 个字符"><?php if(!empty($v)): ?><?php echo $v['content_old']; ?><?php endif; ?></textarea>
                                    </div>
                                </div>
                                <i class="c-p fs-12 cr-red content-app-items-rem-sub">删除</i>
                                <i class="c-m fs-12 drag-sort-submit">拖拽排序</i>
                            </li>
                            <?php endforeach; ?>
                            <?php endif; ?>
                        </ul>
                        <span class="business-operations-submit content-app-items-add-sub">+添加手机详情</span>
                    </div>

                    <!-- web内容 
                    <div id="goods-nav-web" class="division-block">
                        <label class="block nav-detail-title">电脑端详情</label>
                        <div class="am-form-group">
                            <textarea class="am-radius am-validate" name="content_web" maxlength="105000" id="editor-tag" data-validation-message="电脑端详情内容最多 105000 个字符"><?php if(!empty($data)): ?><?php echo htmlentities($data['content_web']); ?><?php endif; ?></textarea>
                        </div>
                    </div>
-->
                    <!-- 扩展数据 
                    <div id="goods-nav-extends" class="division-block">
                        <label class="block nav-detail-title">扩展数据<span class="am-form-group-label-tips-must">该区域为插件扩展数据，请按照插件文档填写相应的值</span></label>
                         插件扩展数据 start  
                        <?php if(isset($shopxo_is_develop) and $shopxo_is_develop == true): ?>
                        <div class="plugins-tag">
                            <span>plugins_view_admin_goods_save</span>
                        </div>
                        <?php endif; if(!empty($plugins_view_admin_goods_save_data) and is_array($plugins_view_admin_goods_save_data)): foreach($plugins_view_admin_goods_save_data as $hook): if(is_string($hook) or is_int($hook)): ?>
                        <?php echo $hook; ?>
                        <?php endif; ?>
                        <?php endforeach; else: ?>
                        <div class="table-no"><i class="am-icon-warning"></i> 没有扩展数据</div>
                        <?php endif; ?>
                        <!-- 插件扩展数据 end  
                    </div>
-->
                    <!-- seo -->
                    <div id="goods-nav-seo" class="division-block">
                        <label class="block nav-detail-title">SEO</label>
                        <div class="am-form-group">
    <label>SEO标题<span class="am-form-group-label-tips">一般不超过80个字符</span></label>
    <input type="text" name="seo_title" placeholder="SEO标题" maxlength="100" data-validation-message="SEO标题格式 最多80个字符" class="am-radius" <?php if(!empty($data['seo_title'])): ?> value="<?php echo htmlentities($data['seo_title']); ?>"<?php endif; ?> />
</div>
<div class="am-form-group">
    <label>SEO关键字<span class="am-form-group-label-tips">一般不超过100个字符，多个关键字以半圆角逗号 [ , ] 隔开</span></label>
    <input type="text" name="seo_keywords" placeholder="SEO关键字" maxlength="130" data-validation-message="SEO关键字格式 最多130个字符" class="am-radius" <?php if(!empty($data['seo_keywords'])): ?> value="<?php echo htmlentities($data['seo_keywords']); ?>"<?php endif; ?> />
</div>
<div class="am-form-group">
    <label>SEO描述<span class="am-form-group-label-tips">一般不超过200个字符</span></label>
    <textarea rows="4" name="seo_desc" maxlength="230" class="am-radius" placeholder="SEO描述" data-validation-message="SEO描述格式 最多230个字符"><?php if(!empty($data['seo_desc'])): ?><?php echo htmlentities($data['seo_desc']); ?><?php endif; ?></textarea>
</div>
                    </div>

                    <div class="am-form-group am-form-group-refreshing">
                        <input type="hidden" name="id" <?php if(!empty($data)): ?> value="<?php echo htmlentities($data['id']); ?>"<?php endif; ?> />
                               <button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
                    </div>
                    </form>
                    <!-- form end -->
                </div>
            </div>
            <!-- right content end  -->

            <!-- 规格扩展数据弹层 -->
            <div class="am-popup" id="specifications-extends-popup">
                <div class="am-popup-inner">
                    <div class="am-popup-hd">
                        <h4 class="am-popup-title">规格扩展数据</h4>
                        <span data-am-modal-close class="am-close">&times;</span>
                    </div>
                    <div class="am-popup-bd">
                        <form class="am-form form-validation-specifications-extends view-save" request-type="sync" request-value="SpecificationsExtendsBack">
                            <?php if(!empty($goods_specifications_extends) and is_array($goods_specifications_extends)): foreach($goods_specifications_extends as $v): ?>
                            <div class="am-alert am-alert-secondary">
                                <label class="am-text-sm"><?php echo htmlentities($v['name']); ?></label>
                                <?php if(!empty($v['desc'])): ?>
                                <span class="am-text-xs am-text-warning am-margin-left-xs"><?php echo htmlentities($v['desc']); ?></span>
                                <?php endif; if(!empty($v['element'])): foreach($v['element'] as $element): ?>
                                <div class="am-form-group">
                                    <label class="block"><?php echo htmlentities($element['title']); if(!empty($element['desc'])): ?><span class="am-form-group-label-tips"><?php echo htmlentities($element['desc']); ?></span><?php endif; ?></label>
                                    <?php switch($element['element']): case "input": if(in_array($element['type'], ['radio', 'checkbox']) and !empty($element['element_data']) and is_array($element['element_data'])): foreach($element['element_data'] as $element_data_key=>$element_data): ?>
                                    <label class="<?php if(isset($element['is_block']) and $element['is_block'] == 1): ?>am-<?php echo htmlentities($element['type']); else: ?>am-<?php echo htmlentities($element['type']); ?>-inline<?php endif; ?>">
                                        <input
                                            type="<?php echo htmlentities($element['type']); ?>"
                                            name="<?php echo htmlentities($element['name']); ?>"
                                            value="<?php echo htmlentities($element_data['value']); ?>"

                                            <?php if(isset($data['config'][$element['name']]) and in_array($element_data['value'], explode(',', $data['config'][$element['name']]))): ?> checked<?php endif; if(isset($element['minchecked']) and $element['type'] == 'checkbox'): ?> minchecked="<?php echo htmlentities($element['minchecked']); ?>"<?php endif; if(isset($element['maxchecked']) and $element['type'] == 'checkbox'): ?> maxchecked="<?php echo htmlentities($element['maxchecked']); ?>"<?php endif; if(isset($element['message'])): ?> data-validation-message="<?php echo htmlentities($element['message']); ?>"<?php endif; if($element_data_key == 0 and isset($element['is_required']) and $element['is_required'] == 1): ?>required<?php endif; ?>
                                            data-am-ucheck />
                                            <?php echo htmlentities($element_data['name']); ?>
                                    </label>
                                    <?php endforeach; else: ?>
                                    <input
                                        class="am-radius"
                                        type="<?php echo htmlentities($element['type']); ?>"
                                        name="<?php echo htmlentities($element['name']); ?>"
                                        value="<?php if(isset($data['config'][$element['name']])): ?><?php echo htmlentities($data['config'][$element['name']]); else: if(isset($element['default'])): ?><?php echo htmlentities($element['default']); ?><?php endif; ?><?php endif; ?>"

                                        <?php if(isset($element['placeholder'])): ?> placeholder="<?php echo htmlentities($element['placeholder']); ?>"<?php endif; if(isset($element['message'])): ?> data-validation-message="<?php echo htmlentities($element['message']); ?>"<?php endif; if(isset($element['is_required']) and $element['is_required'] == 1): ?> required<?php endif; ?>
                                        />
                                        <?php endif; break; case "select": if(!empty($element['element_data']) and is_array($element['element_data'])): ?>
                                        <select
                                        class="chosen-select am-radius"
                                        name="<?php echo htmlentities($element['name']); ?>"

                                        <?php if(isset($element['message'])): ?> data-validation-message="<?php echo htmlentities($element['message']); ?>"<?php endif; if(!empty($element['placeholder'])): ?> data-placeholder="<?php echo htmlentities($element['placeholder']); ?>"<?php endif; if(isset($element['is_multiple']) and $element['is_multiple'] == 1): ?>
                                        multiple
                                        <?php if(isset($element['minchecked'])): ?> minchecked="<?php echo htmlentities($element['minchecked']); ?>"<?php endif; if(isset($element['maxchecked'])): ?> maxchecked="<?php echo htmlentities($element['maxchecked']); ?>"<?php endif; ?>
                                        <?php endif; if(isset($element['is_required']) and $element['is_required'] == 1): ?>required<?php endif; ?>
                                        >
                                        <?php if(!isset($element['is_multiple']) or $element['is_multiple'] != 1): if(!empty($element['placeholder'])): ?>
                                        <option value=""><?php echo htmlentities($element['placeholder']); ?></option>
                                        <?php endif; ?>
                                        <?php endif; foreach($element['element_data'] as $element_data_key=>$element_data): ?>
                                        <option
                                            value="<?php echo htmlentities($element_data['value']); ?>"
                                            <?php if(isset($data['config'][$element['name']]) and in_array($element_data['value'], explode(',', $data['config'][$element['name']]))): ?>selected<?php endif; ?>
                                            ><?php echo htmlentities($element_data['name']); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                    <?php endif; break; case "textarea": ?>
                                    <textarea
                                        class="am-radius"
                                        name="<?php echo htmlentities($element['name']); ?>"

                                        <?php if(isset($element['rows'])): ?> rows="<?php echo htmlentities($element['rows']); ?>"<?php endif; if(isset($element['placeholder'])): ?> placeholder="<?php echo htmlentities($element['placeholder']); ?>"<?php endif; if(isset($element['is_required']) and $element['is_required'] == 1): if(isset($element['minlength'])): ?> minlength="<?php echo htmlentities($element['minlength']); ?>"<?php endif; if(isset($element['maxlength'])): ?> maxlength="<?php echo htmlentities($element['maxlength']); ?>"<?php endif; ?>
                                        required
                                        <?php endif; ?>
                                        ><?php if(isset($data['config'][$element['name']])): ?><?php echo htmlentities($data['config'][$element['name']]); else: if(isset($element['default'])): ?><?php echo htmlentities($element['default']); ?><?php endif; ?><?php endif; ?></textarea>
                                    <?php break; ?>
                                    <?php endswitch; ?>
                                </div>
                                <?php endforeach; ?>
                                <?php endif; ?>
                            </div>
                            <?php endforeach; ?>

                            <div class="am-form-group am-form-group-refreshing">
                                <button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block">确认</button>
                            </div>
                            <?php else: ?>
                            <div class="table-no"><i class="am-icon-warning"></i> 没有扩展数据</div>
                            <?php endif; ?>
                        </form>
                    </div>
                </div>
            </div>

            <!-- footer start -->
            <!-- commom html -->
<textarea id="upload-editor-view" data-url="<?php echo MyUrl('admin/ueditor/index', ['path_type'=>empty($editor_path_type) ? 'common' : $editor_path_type]); ?>" style="display: none;"></textarea>

<!-- 公共底部钩子 -->
<?php if(!empty($plugins_admin_view_common_bottom_data) and is_array($plugins_admin_view_common_bottom_data) and (!isset($is_footer) or $is_footer == 1)): foreach($plugins_admin_view_common_bottom_data as $hook): if(is_string($hook) or is_int($hook)): ?>
            <?php echo $hook; ?>
        <?php endif; ?>
    <?php endforeach; ?>
<?php endif; ?>

</body>
</html>

<!-- 类库 -->
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/jquery/jquery-2.1.0.js"></script>
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/assets/js/amazeui.min.js"></script>

<!-- echarts 图表 -->
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/echarts/echarts.min.js"></script>
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/echarts/macarons.js"></script>

<!-- ueditor 编辑器 -->
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/ueditor/ueditor.config.js"></script>
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/ueditor/ueditor.all.js"></script>
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/ueditor/lang/zh-cn/zh-cn.js"></script>

<!-- 颜色选择器 -->
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/colorpicker/jquery.colorpicker.js"></script>

<!-- 元素拖拽排序插件 -->
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/dragsort/jquery.dragsort-0.5.2.min.js"></script>

<!-- 动画数数 -->
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/animation-count-to/animation.count.to.js"></script>

<!-- amazeui插件 -->
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/amazeui-switch/amazeui.switch.min.js"></script>
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/amazeui-chosen/amazeui.chosen.min.js"></script>
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/amazeui-dialog/amazeui.dialog.min.js"></script>
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/amazeui-tagsinput/amazeui.tagsinput.min.js"></script>

<!-- 日期组件 -->
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/My97DatePicker/WdatePicker.js"></script>

<!-- 元素拖动 -->
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/lib/tdrag/tdrag.min.js"></script>

<!-- 隐藏编辑器初始化 -->
<script type="text/javascript">
    var upload_editor = UE.getEditor("upload-editor-view", {
        isShow: false,
        focus: false,
        enableAutoSave: false,
        autoSyncData: false,
        autoFloatEnabled:false,
        wordCount: false,
        sourceEditor: null,
        scaleEnabled:true,
        toolbars: [["insertimage", "insertvideo", "attachment"]]
    });
</script>

<!-- 项目公共 -->
<script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/common/js/common.js"></script>

<!-- 应用插件公共js -->
<?php if(!empty($plugins_js)): ?>
    <script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/<?php echo htmlentities($plugins_js); ?>"></script>
<?php endif; ?>

<!-- 当前控制器js -->
<?php if(!empty($module_js)): ?>
    <script type='text/javascript' src="<?php echo htmlentities(__MY_ROOT_PUBLIC__); ?>static/<?php echo htmlentities($module_js); ?>"></script>
<?php endif; ?>

<!-- js钩子 -->
<?php if(!empty($plugins_admin_js_data) and is_array($plugins_admin_js_data)): foreach($plugins_admin_js_data as $hook): if(is_string($hook)): ?>
            <script type='text/javascript' src="<?php echo htmlentities($hook); ?>"></script>
        <?php elseif(is_array($hook)): foreach($hook as $hook_js): if(is_string($hook_js)): ?>
                    <script type='text/javascript' src="<?php echo htmlentities($hook_js); ?>"></script>
                <?php endif; ?>
            <?php endforeach; ?>
        <?php endif; ?>
    <?php endforeach; ?>
<?php endif; ?>

<!-- 公共页面底部钩子 -->
<?php if(!empty($plugins_admin_common_page_bottom_data) and is_array($plugins_admin_common_page_bottom_data)): foreach($plugins_admin_common_page_bottom_data as $hook): if(is_string($hook) or is_int($hook)): ?>
            <?php echo $hook; ?>
        <?php endif; ?>
    <?php endforeach; ?>
<?php endif; ?>
            <!-- footer end -->

            <!-- 拖拽排序初始化 -->
            <script type="text/javascript">
                // 规格扩展返回处理
                function SpecificationsExtendsBack()
                {
                    var $extends_popup = $('#specifications-extends-popup');
                    var data = GetFormVal('#specifications-extends-popup', true);
                    $('.specifications-table').find($extends_popup.attr('data-line-extend')).find('.line-extend-input').val(JSON.stringify(data));
                    $extends_popup.modal('close');
                }
            </script>